import React from 'react';
import * as echarts from 'echarts';


function For(props) {

    setTimeout(() => {
        var chartDom = document.getElementById('main4');
var myChart = echarts.init(chartDom);
var option;

option = {
  title: {
    text: '销量展示'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['邮件营销', '联盟广告', '规格广告', '直接访问', '搜索引擎']
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  toolbox: {
    feature: {
      saveAsImage: {}
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
  
    {
      name: '邮件营销',
      type: 'line',
   
    },
    {
      name: '联盟广告',
      type: 'line',
      stack: 'Total',
      data: [150, 232, 201, 154, 190, 330, 410]
    },
    {
      name: '规格广告',
      type: 'line',

    },
    {
      name: '直接访问',
      type: 'line',

    },
    {
      name: '搜索引擎',
      type: 'line',

    },
  ]
};

option && myChart.setOption(option);

    }, 200);

    return (
        <div>
            <div id="main4" style={{width:'100%',height:180}}></div>
            
        </div>
    );
}

export default For;